/*
 * OneTree.h
 *
 *  Created on: 24/apr/2013
 *      Authors: Ialenti Andrea, Marangon Fabio
 */

#ifndef ONETREE_H_
#define ONETREE_H_

#include "StatusCodes.h"
#include "Types.h"

#include <time.h>

//	Function used to find the 2 min-cost edges connected to node 'v0'.
Status findMinCostEdges(const Config *cfg, const Graph *g, int *idx1, int *idx2);

//	Function used to create the minimum spanning tree (MST) from the graph g excluding node 'v0'.
Status PrimDijkstra(const Config *cfg, const Graph *g, OneTree *t);

//	Create the 1-tree from the graph.
Status computeOneTree(const Config *cfg, const Graph *g, OneTree *t);

//	Check if a 1-tree is a tour.
bool checkTour(const OneTree *t);

//	Reset the 1-tree costs to the graph original costs, and set the total cost of the tree to 0.
Status resetCosts(OneTree *t);

//	Function used to deep copy a 1-tree.
Status cpTree(const OneTree *src, OneTree *dest);

#endif /* ONETREE_H_ */
